package com.d3works.apps.bankpayment.service.bankorder;

import com.d3works.apps.account.db.InvoicePayment;
import com.d3works.apps.bankpayment.db.BankOrder;
import com.d3works.exception.D3worksException;
import com.google.inject.persist.Transactional;
import java.time.LocalDate;
import java.util.Collection;

public interface BankOrderMergeService {

  @Transactional(rollbackOn = {Exception.class})
  public BankOrder mergeBankOrders(Collection<BankOrder> bankOrders) throws D3worksException;

  /**
   * Merge bank orders from invoice payments.
   *
   * @param invoicePayments
   * @return
   * @throws D3worksException
   */
  BankOrder mergeFromInvoicePayments(Collection<InvoicePayment> invoicePayments)
      throws D3worksException;

  BankOrder mergeFromInvoicePayments(
      Collection<InvoicePayment> invoicePayments, LocalDate bankOrderDate) throws D3worksException;
}
